/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.base.entity.customer;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 客户Entity
 * @author lv
 * @version 2021-02-25
 */
@Table(name="t_customer_contact", alias="a", columns={
		@Column(name="contact_id", attrName="contactId", label="联系人ID", isPK=true),
		@Column(name="contact_name", attrName="contactName", label="姓名", queryType=QueryType.LIKE),
		@Column(name="position", attrName="position", label="职务"),
		@Column(name="phone", attrName="phone", label="联系电话"),
		@Column(name="email", attrName="email", label="邮箱"),
		@Column(name="contact_person_addr", attrName="contactPersonAddr", label="联系人地址"),
		@Column(name="main_flag", attrName="mainFlag", label="是否主要联系人"),
		@Column(name="customer_id", attrName="customerId.customerId", label="客户ID"),
	}, orderBy="a.contact_id ASC"
)
public class CustomerContact extends DataEntity<CustomerContact> {
	
	private static final long serialVersionUID = 1L;
	private String contactId;		// 联系人ID
	private String contactName;		// 姓名
	private String position;		// 职务
	private String phone;		// 联系电话
	private String email;		// 邮箱
	private String contactPersonAddr;		// 联系人地址
	private String mainFlag;		// 是否主要联系人
	private Customer customerId;		// 客户ID 父类
	
	public CustomerContact() {
		this(null);
	}


	public CustomerContact(Customer customerId){
		this.customerId = customerId;
	}
	
	public String getContactId() {
		return contactId;
	}

	public void setContactId(String contactId) {
		this.contactId = contactId;
	}
	
	@NotBlank(message="姓名不能为空")
	@Length(min=0, max=100, message="姓名长度不能超过 100 个字符")
	public String getContactName() {
		return contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}
	
	@NotBlank(message="职务不能为空")
	@Length(min=0, max=100, message="职务长度不能超过 100 个字符")
	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}
	
	@NotBlank(message="联系电话不能为空")
	@Length(min=0, max=100, message="联系电话长度不能超过 100 个字符")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Length(min=0, max=100, message="邮箱长度不能超过 100 个字符")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	@Length(min=0, max=255, message="联系人地址长度不能超过 255 个字符")
	public String getContactPersonAddr() {
		return contactPersonAddr;
	}

	public void setContactPersonAddr(String contactPersonAddr) {
		this.contactPersonAddr = contactPersonAddr;
	}
	
	@Length(min=0, max=1, message="是否主要联系人长度不能超过 1 个字符")
	public String getMainFlag() {
		return mainFlag;
	}

	public void setMainFlag(String mainFlag) {
		this.mainFlag = mainFlag;
	}
	
	@Length(min=0, max=64, message="客户ID长度不能超过 64 个字符")
	public Customer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Customer customerId) {
		this.customerId = customerId;
	}
	
}